Use pango_layout_get_caret_pos
authorMatthias Clasen <mclasen@redhat.com>
Tue, 24 Aug 2021 20:49:30 +0000 (16:49 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 25 Aug 2021 10:53:53 +0000 (06:53 -0400)
This new api returns rectangles for sloped carets,
in contrast to pango_layout_get_cursor_pos, which
always returns a rectangle with a width of zero.

gtk/gtkstylecontext.c

index 2642106bf0be485e8722e4502ff79d3ea4f496c7..864ee19da1c911c458a226606c3602c7dcdb1c04 100644 (file)
@@ -1166,7 +1166,7 @@ gtk_snapshot_render_insertion_cursor (GtkSnapshot     *snapshot,
         keyboard_direction = gdk_device_get_direction (keyboard);
     }
 
-  pango_layout_get_cursor_pos (layout, index, &strong_pos, &weak_pos);
+  pango_layout_get_caret_pos (layout, index, &strong_pos, &weak_pos);
 
   direction2 = PANGO_DIRECTION_NEUTRAL;